﻿using System;
using System.Runtime.InteropServices;

namespace Vtron.HipcConfigurationTools.Domain
{
    /// <summary>
    /// 网络协议数据头
    /// </summary>
    /// <remarks>
    /// typedef struct
    /// {                      
    ///     Uint32    sync;          //协议区分字段
    ///     Uint32    msgType;      //消息类型
    ///     Uint32    id;           //MSG Id
    ///     Uint32    len;           //消息长度
    ///     Uint32    errCode;       //错误码
    /// } T_HIPC_NET_HEADER;
    /// </remarks>
    [Serializable]
    [StructLayout(LayoutKind.Sequential, Pack = 1)]
    public struct T_HIPC_NET_HEADER
    {
        #region Fields

        /// <summary>
        /// 协议版本号
        /// </summary>
        public int sync;

        /// <summary>
        /// 消息类型 ID
        /// </summary>
        public int msgType;

        /// <summary>
        /// MSG Id
        /// </summary>
        public int id;

        /// <summary>
        /// 消息长度
        /// </summary>
        public int len;

        /// <summary>
        /// 错误码
        /// </summary>
        public int errCode;

        #endregion
    }
}
